#!/bin/sh
echo "set channel " $1
echo "set antenna" $2
echo "set txpower qdbm" $3

./wl -i eth6 down
./wl -i eth6 mpc 0
./wl -i eth6 country ALL
./wl -i eth6 mimo_bw_cap 1
./wl -i eth6 phy_watchdog 0
./wl -i eth6 stbc_tx 0
./wl -i eth6 stbc_rx 0
./wl -i eth6 tempsense_disable 1
./wl -i eth6 up
./wl -i eth6 ap 0
./wl -i eth6 interference 0
./wl -i eth6 interference_override 0
./wl -i eth6 rtsthresh 1714
./wl -i eth6 phy_percal
./wl -i eth6 glacial_timer 15000
./wl -i eth6 fast_timer 15000
./wl -i eth6 slow_timer 15000
./wl -i eth6 scansuppress 0
./wl -i eth6 phy_scraminit 127
./wl -i eth6 pkteng_stop tx
./wl -i eth6 pkteng_stop rx
./wl -i eth6 down
./wl -i eth6 band b
./wl -i eth6 rxchain $2
./wl -i eth6 txchain $2
./wl -i eth6 txcore -s 1 -c $2 -o $2 -k $2
./wl -i eth6 up
./wl -i eth6 down
./wl -i eth6 mpc 0
./wl -i eth6 chanspec $1/20
./wl -i eth6 phy_tx_tone 0
./wl -i eth6 up
./wl -i eth6 isup
./wl -i eth6 txpwr1 -o -q $3
./wl -i eth6 2g_rate -h 7 -b 20
#./wl -i eth6 2g_rate -e 8 -l -x 0 -b 20
./wl -i eth6 phy_forcecal 1
./wl -i eth6 phy_activecal 
./wl -i eth6 pkteng_start 80:af:f0:10:00:01 tx 50 1472 0
sleep 1
#./wl -i eth6 phy_tx_tone 1